package com.idgenerator.generator;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Getter
@Setter
@NoArgsConstructor
public class LocalIdGenerator implements IdGenerator {

    private int dataCenterId;

    private int workerId;

    private String gen;

    public LocalIdGenerator(int dataCenterId, int workerId) {
        this.dataCenterId = dataCenterId;
        this.workerId = workerId;
    }


    @Override
    public long nextId() {
        LocalSnowflakeGenerator localSnowflakeGenerator = new LocalSnowflakeGenerator(this.dataCenterId, this.workerId);
        return localSnowflakeGenerator.nextId();
    }


}
